package com.aiyige.page.selectregion.adapter;

import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.selectregion.model.RegionItem;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by zhuyakun on 2017/10/27.
 */

public class SearchResultAdapter extends BaseQuickAdapter<RegionItem, SearchResultAdapter.SearchRegionViewHolder> {


    public SearchResultAdapter() {
        super(R.layout.select_region_item, new LinkedList<RegionItem>());
    }

    @Override
    protected void convert(SearchRegionViewHolder helper, RegionItem item) {
        helper.bindData(item);
    }

    public static class SearchRegionViewHolder extends BaseViewHolder {
        @BindView(R.id.itemTv)
        TextView itemTv;

        public SearchRegionViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

        public void bindData(RegionItem item) {
            itemTv.setText(item.getFullName());
        }

    }
}
